﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Common.DataLayer;

namespace Common.Forms
{
    public partial class IzborDelovodneKnjige : Form
    {
        public int id;

        public IzborDelovodneKnjige()
        {
            InitializeComponent();
        }

        private void IzborDelovodneKnjige_Load(object sender, EventArgs e)
        {
            Common.MultiLanguage.Tool.PrevediFormu(this);
        }

        private void gridControl1_ProcessGridKey(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                this.DialogResult = DialogResult.OK;
                e.Handled = true;
            }
        }

        private void gridControl1_DoubleClick(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void IzborDelovodneKnjige_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (this.DialogResult == DialogResult.OK)
            {
                id = ((Delovodnik)bsDelovodnik.Current).DelovodnikId;
            }
        }
    }
}
